/*
 * @Description: 
 * @Author: houcw
 * @Date: 2024-01-25 14:50:04
 * @LastEditTime: 2024-01-25 14:51:54
 * @LastEditors: houcw
 * @Reference: 
 */
// 引入
const mongoose = require('../db/mongoose');

const PartSchema = new mongoose.Schema({
    id:String,
    name: { // 成分名称
        type: String,
        required: true
      },
      price: { // 单价
        type: Number,
        required: true
      },
      MJProportion: { // 净能MJ
        type: Number,
        required: true
      },
      proteinProportion: { // 可消化粗蛋白
        type: Number,
        required: true
      },
      calciumProportion: { // 钙
        type: Number,
        required: true
      },
      phosphorusProportion: { // 磷
        type: Number,
        required: true
      },
      createTime: { // 创建时间
        type: Date,
        default: Date.now
      },
})

PartSchema.index({id:1});
module.exports = mongoose.model('Part',PartSchema)